import React, { Component } from 'react';
import { DatePicker, Button } from 'antd';
import { connect } from 'react-redux';
import './style.less';
function onChange() {}
class Dashboard extends Component<DashboardProps, DashboardState> {
    loading() {
        this.props.dispatch({
            type: 'dashboard/getList'
        });
    }

    login = () => {
        console.log(this.props, this.props);
        // this.props.history.replace('./login');
    };
    render() {
        return (
            <div>
                <h1>Dashboard page!</h1>
                <div>
                    <DatePicker onChange={onChange} />
                    <br />
                    <Button onClick={this.loading.bind(this)}>fetching</Button>
                    <Button className="login-btn" onClick={this.login}>
                        login
                    </Button>
                </div>
            </div>
        );
    }
}

function mapStateToProps(state: any) {
    return {
        agent: state.agent
    };
}

export default connect(mapStateToProps)(Dashboard);
